dropdown: Fix popup sizing
authorMatthias Clasen <mclasen@redhat.com>
Fri, 24 Jul 2020 13:07:45 +0000 (09:07 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 24 Jul 2020 18:15:04 +0000 (14:15 -0400)
Setting a width request is not quite enough, since
gtk_widget_set_size_request() only queues a resize
when the widget is visible. Explicitly force one
here. Without this, the popup sometimes shows up
too small.

gtk/gtkdropdown.c

index a7c48d5d878a027853033929f2d6768b547137f4..7b169ba780c1a38cbed4a843af5a121b5842cd26 100644 (file)
@@ -379,6 +379,7 @@ gtk_drop_down_size_allocate (GtkWidget *widget,
   gtk_widget_size_allocate (self->button, &(GtkAllocation) { 0, 0, width, height }, baseline);
 
   gtk_widget_set_size_request (self->popup, width, -1);
+  gtk_widget_queue_resize (self->popup);
 
   gtk_native_check_resize (GTK_NATIVE (self->popup));
 }